//
//  CAReplicatorLayer.swift
//  Documentation
//
//  Created by Toj on 3/8/24.
//
// 复制层

// CAReplicatorLayer可以复制自己子层的layer,并且复制的出来的layer和原来的子layer拥有相同的动效。然后通过设置一些属性，就可以完成很酷的效果，非常强大。

https://www.jianshu.com/p/489dbd6c5e63

@available(iOS 3.0, *)
open class CAReplicatorLayer : CALayer {

    
    /* The number of copies to create, including the source object.
     * Default value is one (i.e. no extra copies). Animatable. */
    
    open var instanceCount: Int

    
    /* Defines whether this layer flattens its sublayers into its plane or
     * not (i.e. whether it's treated similarly to a transform layer or
     * not). Defaults to NO. If YES, the standard restrictions apply (see
     * CATransformLayer.h). */
    
    open var preservesDepth: Bool

    
    /* The temporal delay between replicated copies. Defaults to zero.
     * Animatable. */
    
    open var instanceDelay: CFTimeInterval

    
    /* The matrix applied to instance k-1 to produce instance k. The matrix
     * is applied relative to the center of the replicator layer, i.e. the
     * superlayer of each replicated sublayer. Defaults to the identity
     * matrix. Animatable. */
    
    open var instanceTransform: CATransform3D

    
    /* The color to multiply the first object by (the source object). Defaults
     * to opaque white. Animatable. */
    
    open var instanceColor: CGColor?

    
    /* The color components added to the color of instance k-1 to produce
     * the modulation color of instance k. Defaults to the clear color (no
     * change). Animatable. */
    
    open var instanceRedOffset: Float

    open var instanceGreenOffset: Float

    open var instanceBlueOffset: Float

    open var instanceAlphaOffset: Float
}
